package com.ruoyi.service.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.service.mapper.ServiceWorkMapper;
import com.ruoyi.service.domain.ServiceWork;
import com.ruoyi.service.service.IServiceWorkService;

/**
 * 安全作业Service业务层处理
 * 
 * @author yepanpan
 * @date 2025-05-06
 */
@Service
public class ServiceWorkServiceImpl implements IServiceWorkService 
{
    private static final Logger log = LoggerFactory.getLogger(ServiceWorkServiceImpl.class);

    @Autowired
    private ServiceWorkMapper serviceWorkMapper;

    /**
     * 查询安全作业
     * 
     * @param id 安全作业主键
     * @return 安全作业
     */
    @Override
    public ServiceWork selectServiceWorkById(Long id)
    {
        return serviceWorkMapper.selectServiceWorkById(id);
    }

    /**
     * 查询安全作业列表
     * 
     * @param serviceWork 安全作业
     * @return 安全作业
     */
    @Override
    public List<ServiceWork> selectServiceWorkList(ServiceWork serviceWork)
    {
        return serviceWorkMapper.selectServiceWorkList(serviceWork);
    }

    /**
     * 新增安全作业
     * 
     * @param serviceWork 安全作业
     * @return 结果
     */
    @Override
    public int insertServiceWork(ServiceWork serviceWork)
    {
        serviceWork.setCreateTime(DateUtils.getNowDate());
        return serviceWorkMapper.insertServiceWork(serviceWork);
    }

    /**
     * 修改安全作业
     * 
     * @param serviceWork 安全作业
     * @return 结果
     */
    @Override
    public int updateServiceWork(ServiceWork serviceWork)
    {
        serviceWork.setUpdateTime(DateUtils.getNowDate());
        return serviceWorkMapper.updateServiceWork(serviceWork);
    }

    /**
     * 批量删除安全作业
     * 
     * @param ids 需要删除的安全作业主键
     * @return 结果
     */
    @Override
    public int deleteServiceWorkByIds(Long[] ids)
    {
        return serviceWorkMapper.deleteServiceWorkByIds(ids);
    }

    /**
     * 删除安全作业信息
     * 
     * @param id 安全作业主键
     * @return 结果
     */
    @Override
    public int deleteServiceWorkById(Long id)
    {
        return serviceWorkMapper.deleteServiceWorkById(id);
    }


}
